Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[typescript] Add null to return type of OverridableComponent #35311

Merged

Conversation

tsollbach
Copy link
Contributor

closes #32420

@mui-bot
Copy link

mui-bot commented Dec 1, 2022

Messages
📖 Netlify deploy preview: https://deploy-preview-35311--material-ui.netlify.app/

No bundle size changes

Generated by 🚫 dangerJS against 96ea00f

@mnajdova mnajdova requested a review from michaldudak December 1, 2022 15:19
@ZeeshanTamboli ZeeshanTamboli changed the title [OverridableComponent]: add null to return type [typescript] Add null to return type of OverridableComponent Dec 3, 2022
Copy link
Member

@michaldudak michaldudak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! It's a great first PR in MUI!

@@ -20,7 +20,7 @@ export interface OverridableComponent<M extends OverridableTypeMap> {
*/
component: C;
} & OverrideProps<M, C>,
): JSX.Element;
): JSX.Element | null;
(props: DefaultComponentProps<M>): JSX.Element;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this return type should also be JSXElement | null

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Right, I missed it as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[typescript] Incompatible types between React.forwardRef and OverridableComponent
5 participants